#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
struct Student {
    char mun[6];
    char name[10];
    int score[3];
}stu[10];
int main()
{
    int N;
    scanf("%d", &N);
    for (int i = 0; i < N; i++) {
        scanf("%s %s %d %d %d", &stu[i].mun, &stu[i].name, &stu[i].score[0], &stu[i].score[1], &stu[i].score[2]);
    }
    int sum = 0, Max = 0, Maxx = Max, t, a;
    for (a = 0; a < N; a++)
    {
        for (int j = 0; j < 3; j++)
            sum += stu[a].score[j];
        if (Max < sum)
            Max = sum;
        if (Max != Maxx) {
            t = a;
        }
        Maxx = Max;
        sum = 0;
    }
    printf("%s %s %d", stu[t].name, stu[t].mun, Max);
    return 0;
}